import 'package:json_annotation/json_annotation.dart';

part 'calendar_today_model.g.dart';

@JsonSerializable()
class CalendarTodayModel {
  final String? reason;
  final Result? result;
  @JsonKey(name: 'error_code')
  final int? errorCode;

  const CalendarTodayModel({
    this.reason,
    this.result,
    this.errorCode,
  });

  factory CalendarTodayModel.fromJson(Map<String, dynamic> json) =>
      _$CalendarTodayModelFromJson(json);

  Map<String, dynamic> toJson() => _$CalendarTodayModelToJson(this);
}

@JsonSerializable()
class Result {
  final Data? data;

  const Result({
    this.data,
  });

  factory Result.fromJson(Map<String, dynamic> json) =>
      _$ResultFromJson(json);

  Map<String, dynamic> toJson() => _$ResultToJson(this);
}

@JsonSerializable()
class Data {
  final String? animalsYear;
  final String? weekday;
  final String? lunarYear;
  final String? lunar;
  @JsonKey(name: 'year-month')
  final String? yearMonth;
  final String? date;
  final String? suit;
  final String? avoid;
  final String? holiday;
  final String? desc;

  const Data({
    this.animalsYear,
    this.weekday,
    this.lunarYear,
    this.lunar,
    this.yearMonth,
    this.date,
    this.suit,
    this.avoid,
    this.holiday,
    this.desc,
  });

  factory Data.fromJson(Map<String, dynamic> json) =>
      _$DataFromJson(json);

  Map<String, dynamic> toJson() => _$DataToJson(this);
}
